package services;

import dao.CommunityDao;
import entity.CommunityInfo;

import java.sql.SQLException;
import java.util.List;

public class CommunityServices {
    public static void showCommunity() throws SQLException {
        List<CommunityInfo> communityInfoList = CommunityDao.selectCommunity();
        for (CommunityInfo communityInfo:communityInfoList){
            System.out.println("--------------------------------------------");
            System.out.println("商品ID\t分类 \t商品名称\t商品价格\t商品库存");

            System.out.println("\t"+communityInfo.getComId()+
                    " \t"+communityInfo.getClassifyName()+
                    " \t"+communityInfo.getComName()+
                    "\t\t"+communityInfo.getComPrice()+
                    "\t\t"+communityInfo.getComCount());
        }
        System.out.println("--------------------------------------------");
    }
}
